package com.bdqn.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bdqn.crm.mapper.SysUserMapper;
import com.bdqn.crm.pojo.Pagee;
import com.bdqn.crm.pojo.SysUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("sysUserService")
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {
    @Resource
    private SysUserMapper sysUserMapper;
    @Override
    public SysUser getlogin(String usrName, String usrPassword) {
        return sysUserMapper.getlogin(usrName,usrPassword);
    }

    @Override
    public List<SysUser> getPageList(SysUser sysUser, Pagee pagee) {
        int pageIndex=(pagee.getCurrPageNo()) * pagee.getPageSize();
        return sysUserMapper.getPageList(sysUser,pageIndex,pagee.getPageSize());
    }

    @Override
    public int getPageListTotal(SysUser sysUser) {
        return sysUserMapper.getPageListTotal(sysUser);
    }
}
